package com.hejing.bpeldesign.model;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public class ThrowNode extends BpelNode {

    @Getter
    public static class Input {
        private final String variable;
        private final String constant;
        private final String type;

        public Input(String variable, String constant, String type) {
            this.variable = variable;
            this.constant = constant;
            this.type = type;
        }
    }

    private final String faultName;
    private final String variable;
    private final List<Input> inputs = new ArrayList<>();

    public ThrowNode(String id, String name, String type, int x, int y, int width, int height,
                     String faultName, String variable) {
        super(id, name, type, x, y, width, height);
        this.faultName = faultName;
        this.variable = variable;
    }

    public void addInput(String variable, String constant, String type) {
        inputs.add(new Input(variable, constant, type));
    }
}
